[Fleet] Extend OTel exporter configuration#259308
Conversation
|
@elasticmachine merge upstream |
|
Example of policy generated after this change: id: e60a406d-7f8e-4afc-bfc6-b399f55090f9
revision: 6
outputs:
a32c37a7-900b-4440-8c06-a6514e095098:
type: elasticsearch
hosts:
- http://test-host:80
secrets:
ssl:
key:
id: 6ZAvH50BFEDfHFivzCrf
ssl:
certificate: certificate
certificate_authorities: []
key: '-----BEGIN PRIVATE KEY-----LEAK_ME_PROXY_KEY-----END PRIVATE KEY-----'
proxy_url: https://proxy.internal.example:8443
proxy_headers:
Authorization: Bearer PROXY_SECRET
preset: balanced
fleet:
hosts:
- https://host.docker.internal:8220
output_permissions:
a32c37a7-900b-4440-8c06-a6514e095098:
_elastic_agent_monitoring:
indices:
- names:
- logs-elastic_agent.apm_server-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.apm_server-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.auditbeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.auditbeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.cloud_defend-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.cloudbeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.cloudbeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.elastic_agent-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.endpoint_security-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.endpoint_security-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.filebeat_input-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.filebeat_input-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.filebeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.filebeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.fleet_server-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.fleet_server-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.heartbeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.heartbeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.metricbeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.metricbeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.osquerybeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.osquerybeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.packetbeat-default
privileges:
- auto_configure
- create_doc
- names:
- metrics-elastic_agent.packetbeat-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.pf_elastic_collector-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.pf_elastic_symbolizer-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.pf_host_agent-default
privileges:
- auto_configure
- create_doc
- names:
- logs-elastic_agent.status_change-default
privileges:
- auto_configure
- create_doc
_elastic_agent_checks:
cluster:
- monitor
1a458fca-7c0f-4cf0-bd2c-291ff8844f1c:
indices:
- names:
- logs-*-*
privileges:
- auto_configure
- create_doc
agent:
download:
sourceURI: https://artifacts.elastic.co/downloads/
ssl:
key: '-----BEGIN PRIVATE KEY-----LEAK_ME_PROXY_KEY-----END PRIVATE KEY-----'
proxy_url: https://proxy.internal.example:8443
proxy_headers:
Authorization: Bearer PROXY_SECRET
monitoring:
enabled: true
use_output: a32c37a7-900b-4440-8c06-a6514e095098
logs: true
metrics: true
traces: true
namespace: default
features: {}
protection:
enabled: false
uninstall_token_hash: ***
signing_key: ***
inputs: []
signed:
...
receivers:
filelog/otelcol-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-otelcol-filelog_otel-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c:
include:
- aaaa
start_at: end
max_concurrent_files: 1024
include_file_name: true
include_file_path: false
include_file_name_resolved: false
include_file_path_resolved: false
include_file_owner_name: false
include_file_owner_group_name: false
include_file_record_number: false
include_file_record_offset: false
encoding: utf-8
preserve_leading_whitespaces: false
preserve_trailing_whitespaces: false
fingerprint_size: 1kb
initial_buffer_size: 16KiB
max_log_size: 1MiB
poll_interval: 200ms
force_flush_period: 500ms
service:
pipelines:
logs/otelcol-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-otelcol-filelog_otel-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c:
receivers:
- >-
filelog/otelcol-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-otelcol-filelog_otel-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c
processors:
- >-
transform/otelcol-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-otelcol-filelog_otel-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-routing
exporters:
- forward
logs:
receivers:
- forward
exporters:
- elasticsearch/a32c37a7-900b-4440-8c06-a6514e095098
extensions:
- beatsauth/a32c37a7-900b-4440-8c06-a6514e095098
processors:
transform/otelcol-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-otelcol-filelog_otel-filelogreceiver-1a458fca-7c0f-4cf0-bd2c-291ff8844f1c-routing:
log_statements:
- context: log
statements:
- set(attributes["data_stream.type"], "logs")
- set(attributes["data_stream.dataset"], "filelogreceiver")
- set(attributes["data_stream.namespace"], "default")
connectors:
forward: {}
extensions:
beatsauth/a32c37a7-900b-4440-8c06-a6514e095098:
ssl:
certificate: certificate
proxy_url: https://proxy.internal.example:8443
proxy_headers:
Authorization: Bearer PROXY_SECRET
exporters:
elasticsearch/a32c37a7-900b-4440-8c06-a6514e095098:
flush_interval: 10s
endpoints:
- http://test-host:80
auth:
authenticator: beatsauth/a32c37a7-900b-4440-8c06-a6514e095098
secret_references:
- id: 6ZAvH50BFEDfHFivzCrf
namespaces:
- default |
|
Pinging @elastic/fleet (Team:Fleet) |
| if (output.ssl?.certificate_authorities?.length) | ||
| ssl.certificate_authorities = output.ssl.certificate_authorities; | ||
| if (output.ssl?.certificate) ssl.certificate = output.ssl.certificate; | ||
| if (output.ssl?.key) ssl.key = output.ssl.key; |
There was a problem hiding this comment.
should we handle secrets here?
There was a problem hiding this comment.
good catch, I missed it
| [`elasticsearch/${outputID}`]: { | ||
| endpoints: dataOutput.hosts, | ||
| extensions: { | ||
| [beatsauthID]: buildBeatsauthConfig(dataOutput, proxy), |
There was a problem hiding this comment.
when buildBeatsauthConfig returns {}, should we still add beatsauth to extensions and exporters?
There was a problem hiding this comment.
I think we are still adding a beatsuath extension and exporter if the config is empty
|
@elasticmachine merge upstream |
…tion_tests/ci_checks
…tion_tests/ci_checks
|
@elasticmachine merge upstream |
|
@jloleysens there is a failure that keeps happening in the check API contract check: https://buildkite.com/elastic/kibana-pull-request/builds/421398#019d4e7c-00ec-48ad-b6bb-dd0b2f0ad693 I think it's not regenerating the OAS doc, how can I fix it? |
API Contract Breaking Changes — Terraform Provider Impactcc @elastic/fleet The following breaking change(s) affect APIs consumed by the Elastic Terraform Provider.
What to do
See the |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @criamico |
Closes #255019
Summary
Extend OTel exporter configuration: The existing exporter generation only mapped
hostsfrom an Elasticsearch output. All other config (SSL, proxy, TLS, custom params) was ignored.beatsauth/<outputID>extension to every OTel policy that uses an ES output. This extension carries SSL fields and proxy settings from the Fleet output config.otel_exporter_config_yamlfield into the exporter config.presetis intentionally ignored for now (the exporter uses its own defaults).otel_exporter_config_yamland merged into the OTel exporter at policy generation time.Testing
Assign the output you just created to the policy
Add an OTel-based integration - I tested with
filelog_otel-0.2.0but any otel input integration (not content only) will doEdit your output and assign the proxy. Re-fetch the full agent policy — the beatsauth extension should now also include:
Advanced YAML ConfigurationThis parameter should now be visible in the generated policy
Screenshots
Checklist
Check the PR satisfies following conditions.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.